package com.zjh.document.schedule;

import com.zjh.document.service.IOnlyofficeFileInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class overTimeFileInfoAutoDelete {


    @Resource
    private IOnlyofficeFileInfoService onlyofficeFileInfoService;

    // 每天凌晨检查是否有过期的OnlyOffice信息
    @Scheduled(cron = "0 0 0 * * ?")
    public void test1() {
        Integer deleteRows = onlyofficeFileInfoService.deleteOverTimeItems();
        log.info("删除过期的OnlyOffice Info: " + deleteRows);
    }

}
